package ue.client.planets.tiles;

import org.newdawn.slick.Color;
import org.newdawn.slick.Image;

import ue.client.planets.tiles.TileRenderer;

/**
 * Represents and specifies the properties of a tile.
 * @author Lueko
 *
 */
public class Tile {

    private TileGraphic tileGraphic;
    private int color;
    private boolean solid;
    public static int SIZE = 32;
    
    public static Tile err = new Tile(new TileGraphic(32, 32, Color.darkGray), 0, false, false);
    
    /**
     * @param tileGraphic Tile image.
     * @param color Color representation.
     * @param solid True if effected by collision detection.
     * @param toTiles Adds tile to the to render list.
     */
    public Tile(TileGraphic tileGraphic, int color, boolean solid, boolean toTiles) {
        this.tileGraphic = tileGraphic;
        this.color = color;
        this.solid = solid;
        
        if (toTiles) TileRenderer.tiles.add(this);
    }
    
    public Image getTileImage() {
        return tileGraphic.image;
    }
    
    public int getColor() {
    	return color;
    }
    
    public boolean solid() {
        return solid;
    }
    
}
